package tgc.edu.demo.jkxt.entity;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.joda.time.DateTime;

import tgc.edu.demo.jkxt.custom.BaseEntity;

@Entity
@Table(name = "question")
public class Question extends BaseEntity<Integer>{
	private String timu;
	private Integer answer;
	private DateTime create_time;
	private DateTime update_time;
	private List<Xuanxaing> xuanxiang;
	private Integer type;
	public String getTimu() {
		return timu;
	}
	public void setTimu(String timu) {
		this.timu = timu;
	}
	public Integer getAnswer() {
		return answer;
	}
	public void setAnswer(Integer answer) {
		this.answer = answer;
	}
	public DateTime getCreate_time() {
		return create_time;
	}
	public void setCreate_time(DateTime create_time) {
		this.create_time = create_time;
	}
	public DateTime getUpdate_time() {
		return update_time;
	}
	public void setUpdate_time(DateTime update_time) {
		this.update_time = update_time;
	}
	@ManyToMany(cascade = CascadeType.REFRESH ,fetch = FetchType.EAGER)
	@JoinTable(name = "question_xuanxiang",joinColumns = {@JoinColumn(name="question_id")},inverseJoinColumns = {@JoinColumn(name="xuanxiang_id")})
	public List<Xuanxaing> getXuanxiang() {
		return xuanxiang;
	}
	public void setXuanxiang(List<Xuanxaing> xuanxiang) {
		this.xuanxiang = xuanxiang;
	}
	
	
	
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	
	
	

	@Override
	public String toString() {
		return "Question [timu=" + timu + ", answer=" + answer + ", create_time=" + create_time + ", update_time="
				+ update_time + ", xuanxiang=" + xuanxiang + ", type=" + type + "]";
	}
	public Question() {
		super();
	}
	public Question(Integer id) {
		super(id);
	}
}
